<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>

<body>
	<script>
		function Parent() {
			this.isShow = true
			this.info = {
				name: "yhd",
				age: 18,
			};
		}

		Parent.prototype.getInfo = function () {
			console.log(this.info);
			console.log(this.isShow); // true
		}

		function Child() { };
		Child.prototype = new Parent();

		let Child1 = new Child();
		Child1.info.gender = "男";
		Child1.getInfo();  // {name: "yhd", age: 18, gender: "男"}

		let child2 = new Child();
		child2.getInfo();  // {name: "yhd", age: 18, gender: "男"}
		child2.isShow = false

		console.log(child2.isShow); // false
	</script>
</body>

</html>